From 5a3f96be50ac5cc2acdf5fe3c0f538fd4ca8a852 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 22 Aug 2006 11:59:30 +0000 Subject: [PATCH] disable watchdog functionality (except for distance) in ad-hoc mode (fixes #373) SVN-Revision: 4623 --- openwrt/package/wificonf/wificonf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openwrt/package/wificonf/wificonf.c b/openwrt/package/wificonf/wificonf.c index 7f83a8f595..335dbfc3d1 100644 --- a/openwrt/package/wificonf/wificonf.c +++ b/openwrt/package/wificonf/wificonf.c @@ -281,7 +281,7 @@ void start_watchdog(int skfd, char *ifname) { FILE *f; unsigned char buf[8192], wdslist[8192], wbuf[80], *v, *p, *next, *tmp; - int i, j, wds = 0, c = 0, restart_wds = 0, wdstimeout = 0; + int i, j, wds = 0, c = 0, restart_wds = 0, wdstimeout = 0, infra; if (fork()) return; @@ -289,6 +289,8 @@ void start_watchdog(int skfd, char *ifname) f = fopen("/var/run/wifi.pid", "w"); fprintf(f, "%d\n", getpid()); fclose(f); + + infra = strtol(nvram_safe_get(wl_var("infra")), NULL, 0); v = nvram_safe_get(wl_var("wds")); memset(wdslist, 0, 8192); @@ -314,6 +316,9 @@ void start_watchdog(int skfd, char *ifname) else c = 0; + if (infra != 1) + continue; + if (nvram_match(wl_var("mode"), "sta") || nvram_match(wl_var("mode"), "wet")) { i = 0; -- 2.30.2